package com.jeesite.modules.app.sys.area.office;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.jeesite.common.mapper.JsonMapper;
import com.jeesite.modules.conf.AppController;
import com.jeesite.modules.conf.MessageCode;
import com.jeesite.modules.sys.entity.Office;
import com.jeesite.modules.sys.service.AreaService;
import com.jeesite.modules.sys.service.OfficeService;
import com.jeesite.modules.sys.web.user.EmpUserController;

@Controller
@RequestMapping(value = "/app/sys/office/")
public class AppOfficeController {
	@Autowired
	private OfficeService officeService;
	
	@Autowired
	private EmpUserController empUserController;
	@Autowired
	private AreaService areaService;
	@RequestMapping(value = "findList")
	public void findList(Office office,HttpServletRequest request,HttpServletResponse response){
		if(office==null){
			AppController.renderErrorString(response, MessageCode.PARAMETER_IS_NEED, "");
			return;
		}
		List<Office> findList = officeService.findList(office);
		JSONArray arry=JSONObject.parseArray(JsonMapper.toJson(findList));
		AppController.renderSuccessObject(response, arry, MessageCode.SUCCESS_ACK);
	}
	
}
